//
//  KuaiCollectionViewCell.m
//  K8彩票
//
//  Created by zhoubo on 2017/6/9.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "KuaiCollectionViewCell.h"

@interface KuaiCollectionViewCell()

@property (nonatomic,strong) UILabel* numberlbl;

@property (nonatomic,strong) UILabel *awardlbl;

@end

@implementation KuaiCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self setup];
    }
    return self;
}


-(instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super initWithCoder:aDecoder]) {
        [self setup];
        
    }
    return self;
}

-(void)setup
{
    UILabel * label = [[UILabel alloc]   initWithFrame:CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.height*0.7)];
    label.text = @"3";
    label.textAlignment = NSTextAlignmentCenter;
    [label setFont: [UIFont systemFontOfSize:29]];
    [label setTextColor:[UIColor colorWithWhite:130/255.0 alpha:1]];
    
    self.numberlbl = label;

    
    [self.contentView addSubview:label];
    
    UILabel* bottomLbl = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(label.frame), self.contentView.bounds.size.width, self.contentView.bounds.size.height*0.3)];
    [bottomLbl setFont: [UIFont systemFontOfSize:11]];
    bottomLbl.textAlignment = NSTextAlignmentCenter;
    [bottomLbl setTextColor:[UIColor colorWithWhite:150/255.0 alpha:1]];
    

    
    bottomLbl.text = NSLocalizedString(@"奖金240元", @"奖金240元");
    [self.contentView addSubview:bottomLbl];
    
    self.layer.cornerRadius = 5;
    self.contentView.layer.cornerRadius = 5;
//    self.contentView.layer.borderWidth = 0.5f;
//    self.contentView.layer.borderColor = [UIColor clearColor].CGColor;
    self.contentView.layer.masksToBounds = YES;
    self.awardlbl = bottomLbl;
    
    
}

-(void)setSelected:(BOOL)selected
{
//    if (selected == true) {
//        self.numberlbl.textColor = [UIColor whiteColor];
//        self.awardlbl.textColor = [UIColor whiteColor];
////        self.backgroundColor = [UIColor redColor];
//
//    }
//    else
//    {
//        self.numberlbl.textColor = [UIColor grayColor];
//        self.awardlbl.textColor = [UIColor grayColor];
////        self.backgroundColor = [UIColor whiteColor];
//
//    }

}

-(void)settextColor:(UIColor*)color
{
            self.numberlbl.textColor =color;
            self.awardlbl.textColor = color;
}





-(void)setNumber:(NSInteger)number
{
    _number = number;
    self.numberlbl.text = [NSString stringWithFormat:@"%ld",number];
}

-(void)setAward:(NSInteger)award
{
    _award = award;
    self.awardlbl.text = [NSString stringWithFormat:NSLocalizedString(@"奖金%ld元", @"奖金%ld元"),award];
}
@end
